package com.qf.service.impl;

import com.qf.dao.txDao;
import com.qf.service.txService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class txServiceImpl implements txService {
    @Autowired
    txDao txDao;

    public void setTxDao(com.qf.dao.txDao txDao) {
        this.txDao = txDao;
    }

    @Override
    @Transactional
    public void TransMoney(String fromName, String toName, double money) {
        txDao.takeMoney(fromName,money);
        int i=10/0;
        txDao.saveMoney(toName,money);
    }
}
